package com.example.springaop.proxy;

public class HouseProxy implements HouseSubject{

    public HouseProxy(HouseSubject houseSubject) {
        this.houseSubject = houseSubject;
    }

    private HouseSubject houseSubject;
    @Override
    public void rent() {
        //开始代理
        System.out.println("我是中介,开始代理");
        //代理房东出租房子
        houseSubject.rent();
        //代理结束
        System.out.println("我是中介,代理结束");
    }

    @Override
    public void sale() {
        //开始代理
        System.out.println("我是中介,开始代理");
        //代理房东出租房子
        houseSubject.sale();
        //代理结束
        System.out.println("我是中介,代理结束");
    }
}
